﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLCN
{
    public partial class frmTSHT : Form
    {
        public frmTSHT()
        {
            InitializeComponent();
        }

        private void frmTSHT_Load(object sender, EventArgs e)
        {
            
            txtServerName.Text = Chung.ServerName;
            txtServerName.Enabled = false;
            txtUserDatabase.Text = Chung.UserDatabase;
            txtUserDatabase.Enabled = false;
            txtDatabaseName.Text = Chung.DatabaseName;
            txtDatabaseName.Enabled = false;
            txtPassWordDatabase.Text = Chung.PasswordDatabase;
            txtPassWordDatabase.Enabled = false;
            txtAnh.Text = Chung.DuongDanAnh;
            txtAnh.Enabled = false;
            txtBaoCao.Text = Chung.DuongDanrpt;
            txtBaoCao.Enabled = false;
        }

        private void BntTroVe_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSua_Click(object sender, EventArgs e)
        {
            
            txtServerName.Enabled = true;
            txtServerName.Focus();
            txtUserDatabase.Enabled = true;

            txtDatabaseName.Enabled = true;

            txtPassWordDatabase.Enabled = true;

            txtAnh.Enabled = true;

            txtBaoCao.Enabled = true;
        }

        private void btnLuu_Click(object sender, EventArgs e)
        {
            //Lưu dữ liệu vào File path

            txtServerName.Enabled = false;           
            txtUserDatabase.Enabled = false;           
            txtDatabaseName.Enabled = false;            
            txtPassWordDatabase.Enabled = false;           
            txtAnh.Enabled = false;            
            txtBaoCao.Enabled = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form frm = new FrmSQL();
            frm.Show();
        }
    }
}
